package com.justgame.project.service.system.feign;

import com.justgame.project.service.api.feign.ISysDictClient;
import com.justgame.project.service.api.vo.SysDictVO;
import com.justgame.project.service.system.mapper.SysDictMapper;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * SysDict 微服务接口实现
 * @author ZhouWeiBo
 * @create 2022/4/12
 */
@RestController
@AllArgsConstructor
public class SysDictClient implements ISysDictClient {

    private final SysDictMapper sysDictMapper;

    @Override
    @GetMapping(GET_DICT_BY_CODE)
    public List<SysDictVO> getDictByCode(@RequestParam("code") String code) {
        return sysDictMapper.getDictByCode(code);
    }

    @Override
    @GetMapping(GET_DICT_BY_ID)
    public SysDictVO getDictById(@RequestParam("id") String id) {
        return sysDictMapper.getDictById(id);
    }

}
